.class public Lcom/a0soft/gphone/app2sd/main/PkgChangedRecv;
.super Landroid/content/BroadcastReceiver;
.source "PkgChangedRecv.java"


# static fields
.field private static final a:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 20
    const-class v0, Lcom/a0soft/gphone/app2sd/main/PkgChangedRecv;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/a0soft/gphone/app2sd/main/PkgChangedRecv;->a:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 18
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method

.method private static a(Landroid/content/Context;Ljava/lang/String;)V
    .locals 10
    .parameter
    .parameter

    .prologue
    const/4 v9, 0x0

    .line 56
    new-instance v0, Lcom/a0soft/gphone/app2sd/a/a;

    invoke-direct {v0}, Lcom/a0soft/gphone/app2sd/a/a;-><init>()V

    .line 57
    invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    invoke-virtual {v0, v1, p1}, Lcom/a0soft/gphone/app2sd/a/a;->a(Landroid/content/pm/PackageManager;Ljava/lang/String;)Lcom/a0soft/gphone/app2sd/a/g;

    move-result-object v1

    .line 58
    if-eqz v1, :cond_0

    .line 64
    invoke-static {}, Lcom/a0soft/gphone/app2sd/main/CoreApp;->h()Lcom/a0soft/gphone/app2sd/main/CoreApp;

    move-result-object v2

    .line 66
    invoke-virtual {v1}, Lcom/a0soft/gphone/app2sd/a/g;->k()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v1}, Lcom/a0soft/gphone/app2sd/a/g;->l()Z

    move-result v0

    if-nez v0, :cond_0

    .line 67
    invoke-static {p0, p1}, Lcom/a0soft/gphone/app2sd/main/PrefWnd;->a(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 111
    :cond_0
    :goto_0
    return-void

    .line 75
    :cond_1
    new-instance v0, Landroid/content/Intent;

    const-class v3, Lcom/a0soft/gphone/app2sd/main/NotiWnd;

    invoke-direct {v0, p0, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 76
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "data://"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 78
    invoke-static {p0, v9, v0, v9}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v3

    .line 80
    const-string v0, "notification"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    .line 81
    new-instance v4, Landroid/app/Notification;

    const v5, 0x7f020028

    const/4 v6, 0x0

    const-wide/16 v7, 0x0

    invoke-direct {v4, v5, v6, v7, v8}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    .line 82
    const v5, 0x7f050029

    const/4 v6, 0x2

    new-array v6, v6, [Ljava/lang/Object;

    invoke-virtual {v1}, Lcom/a0soft/gphone/app2sd/a/g;->a()Ljava/lang/String;

    move-result-object v1

    aput-object v1, v6, v9

    const/4 v1, 0x1

    iget-object v2, v2, Lcom/a0soft/gphone/app2sd/main/CoreApp;->a:Ljava/lang/String;

    aput-object v2, v6, v1

    invoke-virtual {p0, v5, v6}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    const v2, 0x7f05002a

    invoke-virtual {p0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v4, p0, v1, v2, v3}, Landroid/app/Notification;->setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

    .line 89
    iget v1, v4, Landroid/app/Notification;->flags:I

    or-int/lit8 v1, v1, 0x10

    iput v1, v4, Landroid/app/Notification;->flags:I

    .line 91
    invoke-static {p0}, Lcom/a0soft/gphone/app2sd/main/PrefWnd;->b(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 92
    iget v1, v4, Landroid/app/Notification;->defaults:I

    or-int/lit8 v1, v1, 0x2

    iput v1, v4, Landroid/app/Notification;->defaults:I

    .line 94
    :cond_2
    invoke-static {p0}, Lcom/a0soft/gphone/app2sd/main/PrefWnd;->c(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_3

    .line 96
    iget v1, v4, Landroid/app/Notification;->flags:I

    or-int/lit8 v1, v1, 0x1

    iput v1, v4, Landroid/app/Notification;->flags:I

    .line 97
    const v1, -0xffff01

    iput v1, v4, Landroid/app/Notification;->ledARGB:I

    .line 98
    const/16 v1, 0x12c

    iput v1, v4, Landroid/app/Notification;->ledOnMS:I

    .line 99
    const/16 v1, 0x3e8

    iput v1, v4, Landroid/app/Notification;->ledOffMS:I

    .line 101
    :cond_3
    invoke-static {p0}, Lcom/a0soft/gphone/app2sd/main/PrefWnd;->d(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v1

    iput-object v1, v4, Landroid/app/Notification;->sound:Landroid/net/Uri;

    .line 103
    invoke-virtual {p1}, Ljava/lang/String;->hashCode()I

    move-result v1

    invoke-virtual {v0, v1, v4}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    goto/16 :goto_0
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 25
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    .line 31
    invoke-static {p1}, Lcom/a0soft/gphone/app2sd/main/PrefWnd;->a(Landroid/content/Context;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 51
    :cond_0
    :goto_0
    return-void

    .line 38
    :cond_1
    if-eqz v0, :cond_0

    const-string v1, "android.intent.action.PACKAGE_ADDED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 39
    const-string v0, "android.intent.extra.REPLACING"

    const/4 v1, 0x0

    invoke-virtual {p2, v0, v1}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    .line 44
    invoke-virtual {p2}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object v0

    .line 45
    if-eqz v0, :cond_0

    .line 46
    invoke-virtual {v0}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;

    move-result-object v0

    .line 47
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 48
    invoke-static {p1, v0}, Lcom/a0soft/gphone/app2sd/main/PkgChangedRecv;->a(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_0
.end method
